<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father {
            height: 200px;
            width: 200px;
            background-color: pink;
        }
        /* 子盒子没有给宽度则padding不会撑开盒子 */
        
        .son {
            height: 50px;
            width: 200px;
            padding-left: 40px;
            background-color: purple;
        }
    </style>
</head>

<body>
    <div class="father">
        <p class="son"></p>
    </div>
</body>

</html>